<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="catalog" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="customer" tagdir="/WEB-INF/tags/customer"%>
<%@ page language="java" pageEncoding="UTF-8"%>	
<title><fmt:message key="stockNotify.title" /></title>

<content tag="position">
		<fmt:message key="accountMenu.serviceCenter" /> &gt; <b><fmt:message key="stockNotify.sign"/></b>
</content>

<div class="one_tab">
	<div class="tab_05">
	<ul class="content clearfix">
		<li class="curr"><span><fmt:message key="stockNotify.list"/></span></li>
	</ul>
	</div>
</div>

<div class="list_prod clearfix">
	<ul class="row">
		<c:forEach items="${stockNotifyList}" var="stockNotify">
			<li id="${stockNotify.stockNotifyId}">
				<div class="img"><product:productImage product="${stockNotify.product}" sizeType="s1"/></div>
				<div class="name">
					<h4><a href="<product:productUrl product="${stockNotify.product}"/>" title="${stockNotify.product.productName}">${stockNotify.product.productName}</a></h4>
					<p>${stockNotify.memo}</p>
					<div class="do clearfix">
						<div class="statu">
							<c:choose>
								<c:when test="${not empty stockNotify.informStatus and stockNotify.informStatus==1}">
									<span class="arrived"><b><fmt:message key="stockNotify.status.1"/></b></span>
								</c:when>
								<c:otherwise>
									<span class="no_arrived"><b><fmt:message key="stockNotify.status.0"/></b></span>
								</c:otherwise>
							</c:choose>
						</div>
						<div class="op"><a href="javascript:void(0)" onclick="deleteStockNotify(${stockNotify.stockNotifyId},this)"><fmt:message key="stockNotify.list.delete"/></a></div>
					</div>
				</div>
				<div class="info">
					<product:productPrice productSku="${stockNotify.product.defaultProductSku}" multiple="true" hasPriceName="true"/>
					<div class="rank">
						<fmt:formatNumber var="score" value="${stockNotify.product.productStat.reviewScore}" pattern="0.0"/>
						<customer:scoreStar value="${score}"/>
						<span>
							<a href="<customer:productReviewUrl product="${stockNotify.product}"/>" target="_blank">
								<fmt:message key="productDetail.onshowReviewCount.title">
									<fmt:param>${stockNotify.product.productStat.onShowReviewCount}</fmt:param>
								</fmt:message>
							</a>
						</span>
					</div>
				</div>
			</li>
		</c:forEach>
	</ul>
</div>

<div id="emptyInfo" class="msg" <c:if test="${not empty stockNotifyList}">style="display:none;"</c:if> >
	<h3><fmt:message key="stockNotifyList.msg.title"/></h3>
</div>


<script type="text/javascript">
$j(document).ready(function () {
	__FMTExtend = {
		stockNotify_delete_confim:"<i18n:msg key="stockNotify.delete.confim"/>",
	    stockNotify_add_success:"<i18n:msg key="stockNotify.add.success"/>",
	    stockNotify_sign_confirm:"<i18n:msg key="stockNotify.sign.confirm"/>"
	};
	$j.extend(__FMT, __FMTExtend); 
});	

//删除缺货登记
function deleteStockNotify(stockNotifyId){
	if(confirm(__FMT.stockNotify_delete_confim)){
		$j('#'+stockNotifyId).remove();
		$j.post(__ctxPath+'/customer/csStockNotify.html?doAction=deleteStockNotify&stockNotifyId='+stockNotifyId,null,deleteStockNotifyCallback);
	}	
}
//删除缺货登记回调函数
function deleteStockNotifyCallback(){
	if($j('ul.row li').length==0){
		$j('#emptyInfo').show();
	}
}
</script>